import Vue from 'vue'
import Vuex from 'vuex'
import perState from "vuex-persistedstate"
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    num:0
  },
  plugins: [
    perState({
        reducer(val) {
            return {
                products: val.products
            }
        }
    })
],
  mutations: {
    chang(state,val){
      this.state.num+=val
      console.log(this.state.num);
    }
  },
  actions: {
  },
  modules: {
  }
})
